﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using FinPlusCompCore;
using QLNet;
using p = FinPlusCompQuant.QLConvParser;

namespace FinPlusCompQuant
{
    public class FraRate : Rate
    {
        //construct
        public FraRate(Market market, string name, double rate, int start, int end, int fixingDays, string dayCount, string bizConv, string holidays, bool endOfMonth = true)
        {
            Id = name;

            Quote = market.GetQuote(name);
            Quote.linkTo(new SimpleQuote(rate));
            
            RateHelper = new FraRateHelper(Quote, start, end, fixingDays, p.Calendar(holidays), p.BizConv(bizConv), endOfMonth, p.DayCount(dayCount));
            market.SetRateHelper(name, RateHelper);
       }
    }
}
